package com.sensetime.mediacodec;

import android.content.Context;
import android.util.Log;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class FileUtils {
    static String VIDEO_DIR = "video";
    public static File getVideoDir(Context context) {
        File file = new File(context.getExternalCacheDir().getAbsolutePath() + "/" + VIDEO_DIR);
        if (!file.exists()) {
            boolean success = file.mkdirs();
        }
        return file;
    }
    public static File getMp4File(Context context) {
        File file = getVideoDir(context);
        SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss", Locale.CHINA);
        File file1 = new File(file.getAbsolutePath() + File.separator + "video_" + format.format(new Date()) + ".mp4");
        return file1;
    }

}
